package top.liuziqian.shop.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.liuziqian.common.core.text.Convert;
import top.liuziqian.shop.domain.GoodsUnit;
import top.liuziqian.shop.mapper.GoodsUnitMapper;
import top.liuziqian.shop.service.IGoodsUnitService;

import java.util.List;

@Service
public class GoodsUnitServiceImpl implements IGoodsUnitService {

    @Autowired
    private GoodsUnitMapper unitMapper;

    @Override
    public GoodsUnit selectUnitById(Long unitId) {
        return unitMapper.selectUnitById(unitId);
    }

    @Override
    public List<GoodsUnit> selectUnitList(GoodsUnit unit) {
        return unitMapper.selectUnitList(unit);
    }

    @Override
    public int insertUnit(GoodsUnit unit) {
        return unitMapper.insertUnit(unit);
    }

    @Override
    public int updateUnit(GoodsUnit unit) {
        return unitMapper.updateUnit(unit);
    }

    @Override
    public int deleteUnitByIds(String ids) {
        return unitMapper.deleteUnitByIds(Convert.toStrArray(ids));
    }
}
